package net.tribal.escpos.barcode

import net.tribal.escpos.util.PrinterUtils

public class Jan8BarCode implements BarCode{
	
	void printBarCode(code, out){
		def n = code.size()
		if (n >= 7 && n <=8){
			out << PrinterUtils.getHexValue(29)
			out << PrinterUtils.getHexValue(107)
			out << PrinterUtils.getHexValue(68)
			out << PrinterUtils.getHexValue(n)
			out << code
			out << PrinterUtils.getHexValue(0)
		}
	}
}